package com.itheima.demo;

import com.itheima.config.SpringConfig;
import com.itheima.domain.UserInfo;
import com.itheima.service.UserInfoService;
import com.itheima.service.impl.UserInfoServiceImpl;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.List;

//更改程序运行入口
@RunWith(SpringJUnit4ClassRunner.class)
//指定核心配置类或者核心配置文件
@ContextConfiguration(classes = {SpringConfig.class})
public class Demo {

    //注入serviceInfo
    @Autowired
    private UserInfoService userInfoService;
    //测试
    @Test
    public void test1() {

        List<UserInfo> all = userInfoService.findAll();
        System.out.println(all);
    }
}
